﻿@model ExtremeEvents.Models.Evento

@{
    ViewBag.Title = "Detalhe";
}

<script type="text/javascript">
    //alterar estado dos botoes
    activarBotao("eventos"); //alterar para o nome da view
</script>

<div class="wrapper">
<div class="grid_4" style="width:98%;">
	<h3>@Html.DisplayFor(m => m.titulo)</h3>
	<div class="bg maxheight">
		<div class="content-indents">
            <table width="100%">
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Publicado por</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.userName)</td>
                    <td rowspan="11" width="300">
                    @foreach (var item in ViewBag.src_flyer)
                    {
                        <img id="flyer" src="@Url.Content(item)" alt="Flyer" height="250" width="300" style="padding-bottom:10px; background-color:#fff;" />
                    }
                    </td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Inicio</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.data_inicio)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Final</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.data_fim)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Titulo</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.titulo)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Preço</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.preco)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Morada</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.morada)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Latitude</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.latitude)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Longitude</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.longitude)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Url</h6></td>
                    <td>&nbsp;<a href="@Html.DisplayFor(m => m.url)" target="_blank">@Html.DisplayFor(m => m.url)</a></td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Telefone</h6></td>
                    <td>&nbsp;@Html.DisplayFor(m => m.contacto_telefonico)</td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Email</h6></td>
                    <td>&nbsp;<a href="mailto:@Html.DisplayFor(m => m.email)">@Html.DisplayFor(m => m.email)</a></td>
                </tr>
                <tr>
                    <td align="right" width="100px;"><h6 class="p1">Descrição</h6></td>
                    <td colspan="2">&nbsp;@Html.DisplayFor(m => m.descricao)</td>
                </tr>
            </table>
        </div>
    </div>
</div>
</div>

@{
    if (Model.latitude != null && Model.longitude != null)
    {
        <br />
        <div class="wrapper">
        <div class="grid_4" style="width:98%;">
	        <h3>Mapa - Localização</h3>
	        <div class="bg maxheight">
		        <div class="content-indents" style="padding:0px;">
                    <div id="map" style="width:100%; height:400px;"></div>
                </div>
            </div>
        </div>
        </div>
        <script type="text/javascript">
            var gmap = new google.maps.Map(document.getElementById("map"), {
                zoom: 12, //initial zoom level
                center: new google.maps.LatLng(Number(@Html.DisplayFor(m => m.latitude)), Number(@Html.DisplayFor(m => m.longitude))),
                navigationControl: true, //enable the Map navigation control
                mapTypeControl: true,  //enable the Map type control
                mapTypeControlOptions: {
                    style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
                },
                mapTypeId: google.maps.MapTypeId.ROADMAP, //initial map type (defined by his id)
                panControl: true,
                rotateControl: true,
                scaleControl: false,
                scrollwheel: true,
                streetViewControl: true,
                zoomControl: true,
                overviewMapControl: false
            });

            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(Number(@Html.DisplayFor(m => m.latitude)), Number(@Html.DisplayFor(m => m.longitude))),
                map: gmap,
                title: "Evento"
            });
        </script>
    }


    if (((string[])ViewBag.src_foto).Count() > 0)
    {
        <br />
        <div class="wrapper">
        <div class="grid_4" style="width:98%;">
	        <h3>Galeria</h3>
	        <div class="bg maxheight">
		        <div class="content-indents" style="padding:0px;">
                    <div class="indent-top">
                        <div style="overflow:hidden; height:400px;">
				        <div class="slider-box">
					        <div class="slider">
						        <ul class="items">
                                    @foreach (var item in ViewBag.src_foto)
                                    {
                                        if (item != null)
                                        {
                                            <li><img src="@Url.Content(item)" alt="" height="300" width="300"></li>
                                        }
                                    }
						        </ul>
					        </div>
				        </div>
                        </div>
			        </div>
                </div>
            </div>
        </div>
        </div>
        <script type="text/javascript">
	        $(window).load(function(){
		        $('.slider')._TMS({
			        pauseOnHover:true,
			        duration:800,
			        preset:'simpleFade',
			        pagination:true,//'.pagination',true,'<ul></ul>'
			        pagNums: false,
			        slideshow:7000,
			        numStatus:false,
		        })
	        })
        </script>
        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-7078796-5']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

        </script>
    }
    }

<br />
<div align="right" style="padding-right:20px; padding-bottom:10px;">
<a href="/SubscreverEvento/Subscrever/@Html.DisplayFor(m => m.id_evento)" class="button"><span>subscrever</span></a>
<a href="/Evento/EventosCategoria?id_categoria=@Html.DisplayFor(m => m.id_categoria)" class="button"><span>voltar</span></a>
</div>